home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / varia / rpc.lha / dynload / loadtest.cxx < prev    next >
C/C++ Source or Header  |  1993-08-08  |  984b  |  43 lines

  1. // Copyright (C) 1990 by Glenn Gribble; all rights are reserved.
  2. // This program may be used for any purposes including inclusion in
  3. // for profit programs.  If the source is copied, the copyright notice
  4. // must be included.  Please send bug fixes/reports to glenn@synaptics.com
  5. // This program is distributed without any warranty.
  6.  
  7. // A simple test program for the loader
  8.  
  9. #include <stdio.h>
  10. #include <strings.h>
  11. #include "loader.h"
  12. #include "loaderTest.h"
  13.  
  14. void mainProc(const char *msg)
  15. {
  16.   fprintf(stderr,"mainProc: %s\n", msg);
  17. }
  18.  
  19. testProc procA = mainProc;
  20.  
  21. main(int argc, char **argv)
  22. {
  23.   setArg0(argv[0]);
  24.  
  25.   if (argc > 1) {
  26.     if (strcmp(argv[1], "-debug") == 0) {
  27.       d_all = 1;
  28.     }
  29.     if (strcmp(argv[1], "-quiet") == 0) {
  30.       d_all = d_relocation = d_execs = d_ctors = d_relocation = d_symbols = 0;
  31.     }
  32.   }    
  33.  
  34.   (*procA)("startup");
  35.  
  36.   if (!loadFile("sub.o")) {
  37.     fprintf(stderr,"Could not load subroutine file\n");
  38.     exit(1);
  39.   }
  40.  
  41.   (*procA)("finish");
  42. }
  43.